<?php /* Smarty version 2.6.26, created on 2013-02-12 12:31:58
         compiled from minsshop_form.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'minsshop_form.html', 141, false),array('modifier', 'escape', 'minsshop_form.html', 191, false),array('function', 'html_options', 'minsshop_form.html', 165, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.btn_regist').click(function(){
				if( confirm('登録してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			
			$('.btn_update').click(function(){
				if( confirm('更新してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			$('.btn_return').click(function(){
				location.href = "minsshop_index.php?hist=2";
			});
			$('.btn_search_del').click(function(){
				var theValue = "";
				var urlPara = makeSearchURL( this.id, theValue );
				<?php if (( $this->_tpl_vars['isG4'] )): ?>
				urlPara = urlPara + "&ins=<?php echo $this->_tpl_vars['forms']['ins_co_cd']; ?>
";
				<?php endif; ?>
				$("#dialog").load( urlPara ).dialog({
					modal:true
					}); 
				$('#dialog').dialog('open');
			});
			$('.auth').change(function(){
				if (this.value == 4) {
						$('#tr_op4')['show']();
					} else {
						$('#tr_op4')['hide']();
				}
			});
			
			$("#ins_co_cd").change(function(){
				document.fm.ins_co_name.value = $("#ins_co_cd").find("option:selected").text();
			});
			$("#block_cd").change(function(){
				document.fm.block_name.value = $("#block_cd").find("option:selected").text();
			});

			
			$("#local_cd").change(function(){
				document.fm.local_name.value = $("#local_cd").find("option:selected").text();
			});
		
				$('.text_date').datepicker({
					changeMonth: true,
					changeYear: true,
					dateFormat: 'yy/mm/dd'
				});
		});
			//検索画面から戻す値の処理
		var gPara = "";
		function setS( val ) {
			switch (gPara){
				case "media":
					document.fm.media_name.value = val;
					break;
				case "delive":
					document.fm.delive_name.value = val;
					break;
				case "pattern":
					document.fm.pattern_name.value = val;
					break;
				default:
					alert("paramater error");
					return ;
					break;
			}
			$('#dialog').dialog("close");
		}
		
		function setSS( val,name ) {
	
			switch (gPara){
			case "delive":
				document.fm.delive_cd.value = val;
				document.fm.delive_name.value = name;
				break;
			default:
				alert("paramater error");
				return ;
				break;
		}
		$('#dialog').dialog("close");
	}

		</script>
		
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>折込販売店マスター管理</h2>
			<ul class="submenu clearfix">
				<li><a href="minsshop_index.php">折込販売店情報一覧</a></li>
				<li>折込販売店情報登録</li>
				<li><a href="minsshop_import.php">CSV更新</a></li>
				<?php if (( ! $this->_tpl_vars['isG5'] )): ?> <li><a href="mins_delive_index.php">納品先マスタ</a></li><?php endif; ?>
			</ul>
			<h3>折込販売店情報<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?><?php if ($this->_tpl_vars['phase'] == 'complete'): ?>完了<?php endif; ?></h3>
<?php if ($this->_tpl_vars['phase'] == 'input'): ?>
			<p class="message">内容を確認し、<?php if ($this->_tpl_vars['forms']['id'] == ''): ?>登録<?php else: ?>更新<?php endif; ?>ボタンをクリックしてください。</p>
			<form name="fm" action="minsshop_form.php" method="post">
				<table class="formTable">
					<tbody>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
						<tr>
							<th>更新日</th>
							<td>
								<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['u_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y/%m/%d %H:%M") : smarty_modifier_date_format($_tmp, "%Y/%m/%d %H:%M")); ?>
<input type="hidden" name="u_time" value="<?php echo $this->_tpl_vars['forms']['u_time']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>更新者</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
<input type="hidden" name="m_user_name" value="<?php echo $this->_tpl_vars['forms']['m_user_name']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>ID</th>
							<td>
								<?php echo $this->_tpl_vars['forms']['id']; ?>

							</td>
						</tr>
<?php endif; ?>
<?php if (( ! $this->_tpl_vars['isG5'] )): ?> 
						<tr id = "tr_op4" >
							<th>※折込会社</th>
							<td>
<?php if (( $this->_tpl_vars['isG4'] )): ?> 
								<input type="text " name="ins_co_name"  class="dtext" value="<?php echo $this->_tpl_vars['forms']['ins_co_name']; ?>
"  readonly/>
								<input type="hidden" name="ins_co_cd" value="<?php echo $this->_tpl_vars['forms']['ins_co_cd']; ?>
" />
<?php else: ?>
	<?php echo smarty_function_html_options(array('id' => 'ins_co_cd','name' => 'ins_co_cd','options' => $this->_tpl_vars['ins_co'],'selected' => $this->_tpl_vars['forms']['ins_co_cd']), $this);?>

								<input type="hidden" name="ins_co_name" value="<?php echo $this->_tpl_vars['forms']['ins_co_name']; ?>
" />
<?php endif; ?>
								<?php echo $this->_tpl_vars['err']['ins_co_cd']; ?>

							</td>
						</tr>
<?php endif; ?>
						<tr id = "tr_op4" >
							<th>※地域ブロック</th>
							<td>
	<?php echo smarty_function_html_options(array('id' => 'block_cd','name' => 'block_cd','options' => $this->_tpl_vars['block'],'selected' => $this->_tpl_vars['forms']['block_cd']), $this);?>
<?php echo $this->_tpl_vars['err']['block_cd']; ?>

	<input type="hidden" name="block_name" value="<?php echo $this->_tpl_vars['forms']['block_name']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>※都道府県</th>
							<td>

	<?php echo smarty_function_html_options(array('id' => 'local_cd','name' => 'local_cd','options' => $this->_tpl_vars['local'],'selected' => $this->_tpl_vars['forms']['local_cd']), $this);?>
<?php echo $this->_tpl_vars['err']['local_cd']; ?>

	<input type="hidden" name="local_name" value="<?php echo $this->_tpl_vars['forms']['local_name']; ?>
" />
							</td>
						</tr>
						<tr>
							<th>※媒体名</th>
							<td>
								<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
									<!--  <input type="text" name="media_name" class="dtext" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['media_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100"   readonly="readonly"/><?php echo $this->_tpl_vars['err']['media_name']; ?>
-->
									<input type="text" name="media_name" class="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['media_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100" /><?php echo $this->_tpl_vars['err']['media_name']; ?>

									<button type="button" id="media" class="btn_search" rel="media"><span>参照</span></button>
								<?php else: ?>
									<input type="text" name="media_name" class="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['media_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100" /><?php echo $this->_tpl_vars['err']['media_name']; ?>

									<button type="button" id="media" class="btn_search" rel="media"><span>参照</span></button>
								<?php endif; ?>
							</td>
						</tr> <tr>
							<th>※GEOコード</th>
							<td>
							<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
								<input type="text" name="ins_shop_cd" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['ins_shop_cd'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="20" class="dtext"  readonly="readonly"/><?php echo $this->_tpl_vars['err']['ins_shop_cd']; ?>

							<?php else: ?>
								<input type="text" name="ins_shop_cd"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['ins_shop_cd'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="20"  class="text" /><?php echo $this->_tpl_vars['err']['ins_shop_cd']; ?>

							<?php endif; ?>
							</td>
						</tr>
						<tr>
							<th>※販売店名</th>
							<td>
								<input type="text" name="ins_shop_name"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['ins_shop_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100"  class="text"/><?php echo $this->_tpl_vars['err']['ins_shop_name']; ?>

							</td>
						</tr>
<?php if (( ! $this->_tpl_vars['isG5'] )): ?> 
						<tr><th>※納品先</th>
							<td>
								<input type="text" name="delive_name" class="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['delive_name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="100" /><?php echo $this->_tpl_vars['err']['delive_name']; ?>

								<input type="hidden" name="delive_cd" class="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['delive_cd'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  />
								<button type="button" class="btn_search_del" id="delive"><span>参照</span></button>
							</td>
						</tr>
						<tr><th>※折込会社部数</th>
							<td>
								<input type="text" name="insert_conums"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['insert_conums'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10"  class="text"/><?php echo $this->_tpl_vars['err']['insert_conums']; ?>

							</td>
						</tr>
<?php endif; ?>
<?php if (( ! $this->_tpl_vars['isG4'] )): ?> 
						<tr>
							<th>地域広告有無</th>
							<td>
								<?php echo smarty_function_html_options(array('id' => 'area_pattern_cd','name' => 'area_pattern_cd','options' => $this->_tpl_vars['pattern'],'selected' => $this->_tpl_vars['forms']['area_pattern_cd']), $this);?>

							</td>
						</tr>
						<tr>
							<th>地域広告部数</th>
							<td>
								<input type="text" name="area_adnums"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['area_adnums'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10"  class="text"/><?php echo $this->_tpl_vars['err']['area_adnums']; ?>

							</td>
						</tr>
						<tr>
							<th>地域広告備考</th>
							<td>
								<textarea name="area_memo" class="textarea"  style="width:380px" /><?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['area_memo'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</textarea><?php echo $this->_tpl_vars['err']['area_memo']; ?>

							</td>
						</tr>
<?php endif; ?>
<?php if (( ! $this->_tpl_vars['isG4'] ) && ( ! $this->_tpl_vars['isG5'] )): ?>
						<tr>
							<th>店舗からの距離</th>
							<td>
								<input type="text" name="shop_away" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['shop_away'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10"  <?php if (( $this->_tpl_vars['isG4'] )): ?> class="dtext"  readonly="readonly" <?php else: ?> class="text" <?php endif; ?> /><?php echo $this->_tpl_vars['err']['shop_away']; ?>

							</td>
						</tr>
						<tr>
							<th>AOKI/競合</th>
							<td>
						<?php if (( $this->_tpl_vars['isG4'] )): ?> 
							<input type="text" name="aoki_compete"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['aoki_compete'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10" class="dtext"  readonly="readonly" />
						<?php else: ?>	
						<?php echo smarty_function_html_options(array('id' => 'aoki_compete','name' => 'aoki_compete','options' => $this->_tpl_vars['aoki_compete'],'selected' => $this->_tpl_vars['forms']['aoki_compete']), $this);?>
<?php echo $this->_tpl_vars['err']['aoki_compete']; ?>

						<?php endif; ?>
							</td>
						</tr>
						<tr>
							<th>世帯普及率</th>
							<td>
								<input type="text" name="home_percent" value="<?php echo $this->_tpl_vars['forms']['home_percent']; ?>
"  maxlangth="10"  <?php if (( $this->_tpl_vars['isG4'] )): ?> class="dtext"  readonly="readonly" <?php else: ?> class="text" <?php endif; ?>/><?php echo $this->_tpl_vars['err']['home_percent']; ?>

							</td>
						</tr>
						<tr>
							<th>総需要額</th>
							<td>
								<input type="text" name="all_amount" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['all_amount'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10" <?php if (( $this->_tpl_vars['isG4'] )): ?> class="dtext"  readonly="readonly" <?php else: ?> class="text" <?php endif; ?>/><?php echo $this->_tpl_vars['err']['all_amount']; ?>

							</td>
						</tr>
						<tr>
							<th>売上高シェア</th>
							<td>
								<input type="text" name="sale_share" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['sale_share'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"  maxlangth="10" <?php if (( $this->_tpl_vars['isG4'] )): ?> class="dtext"  readonly="readonly" <?php else: ?> class="text" <?php endif; ?> /><?php echo $this->_tpl_vars['err']['sale_share']; ?>

							</td>
						</tr>
<?php endif; ?>
<?php if (( ! $this->_tpl_vars['isG5'] )): ?>
						<tr>
							<th rowspan=2>廃止日</th>
							<td>
								<input type="text" name="stop_date" class="text_date" value="<?php echo $this->_tpl_vars['forms']['stop_date']; ?>
"  /><?php echo $this->_tpl_vars['err']['stop_date']; ?>

							</td>
						</tr>
						<tr><td>
							<textarea name="memo" class="textarea"  style="width:380px" /><?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['memo'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</textarea><?php echo $this->_tpl_vars['err']['memo']; ?>

							</td>
						</tr>
<?php endif; ?>
					</tbody>
				</table>
				<p class="button">
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
					<button type="button" class="btn_return" class="submit"><span>戻る</span></button>
					<button type="button" class="btn_update" class="submit"><span>更新</span></button>
<?php else: ?>
				<?php if (! ( $this->_tpl_vars['isG4'] )): ?><button type="button" class="btn_regist" class="submit"><span>登録</span></button><?php endif; ?>
<?php endif; ?>
				</p>
				<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['forms']['id']; ?>
" />
				<input type="hidden" name="mode" value="" />
			</form>

<div id="dialog" >
</div>
 
<?php endif; ?>

<?php if ($this->_tpl_vars['phase'] == 'complete'): ?>
			<p class="message"><?php echo $this->_tpl_vars['message']; ?>
</p>
			<ul>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="minsshop_index.php?hist=2">一覧ページに戻る</a></li>
<?php else: ?>
				<li>>> <a href="minsshop_index.php">一覧ページに戻る</a></li>
<?php endif; ?>
				<li>>> <a href="minsshop_form.php">新規登録</a></li>
<?php if ($this->_tpl_vars['forms']['id'] != ''): ?>
				<li>>> <a href="minsshop_form.php?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
">更新</a></li>
<?php endif; ?>
			</ul>
<?php endif; ?>

		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>